package com.ubs.training.web.util;

import com.ubs.training.server.dao.model.Contract;
import org.springframework.validation.Errors;

/**
 * Created with IntelliJ IDEA.
 * User: xubuntu
 * Date: 8/23/12
 * Time: 5:14 AM
 * To change this template use File | Settings | File Templates.
 */
public class ContractValidator {
    private Contract contract;
    private Errors res;

    public ContractValidator(Contract contract, Errors res) {
        this.contract = contract;
        this.res = res;
    }
    public void validate() {
        if (contract.getMaxBorrow()>99999.99) {
            res.rejectValue("maxBorrow","outOfRange");
        }
    }



}

